import Roact from "@rbxts/roact";
import { ContainerService } from "shared/component/container/ContainerService";
import Log4R from "shared/component/log/Log4R";
import { TestView } from "../views/TestView";

const loginfo = Log4R.getLog('info');
export class TestServiceImpl extends ContainerService<Ctn.TestService, Ctn.TestEntity> implements Ctn.TestService {
    serverCalls: (keyof this)[] = ['test']
    test(entity: Ctn.test.Test1Entity, session: Ctn.Session): void {
        // loginfo?.info("Method not implemented.", entity, session);
        const e2 = this.invoke('test', entity)
        // loginfo?.info("e2", e2);
    }
    test2(entity: Ctn.test.Test2Entity, session: Ctn.Session): void {
        // loginfo?.info("test2:", entity, session);
    }
    serviceName: keyof Ctn.Services = "testService";
    public run(): void {
        if (this.runInLocal()) {
            // const element = Roact.createElement(TestView, {})
            // const playergui = game.GetService('Players').LocalPlayer.FindFirstChild('PlayerGui') as PlayerGui
            // const testScreenGui = new Instance('ScreenGui', playergui);
            // testScreenGui.Name = 'testScreenGui';
            // Roact.mount(element, testScreenGui)
        }
    }
}